package com.example.administrator.acmapp.Adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/2/7/007.
 */

public class QuestionViewPageAdapter extends FragmentPagerAdapter {
    ArrayList<Fragment> fragmentList;
    String [] mTitleName;

    public void setFragments(ArrayList<Fragment> fragments,String[] titles) {
        fragmentList = fragments;
        mTitleName = titles;
    }
    public QuestionViewPageAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return mTitleName[position];
    }
}
